package com.bailan.foreat.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.math.BigDecimal;

/**
 * <p>
 * 
 * </p>
 *
 * @author ste
 * @since 2023-02-21 07:50:43
 */
@Data
@TableName("t_product")
public class Product {

    /**
     * 商品id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 商品名
     */
    @TableField("product_name")
    private String productName;

    /**
     * 商品图片
     */
    @TableField("product_img")
    private String productImg;

    /**
     * 商品价格
     */
    @TableField("product_price")
    private BigDecimal productPrice;

    /**
     * 商品种类(废弃~)
     */
    @TableField("type")
    private Integer type;

    /**
     * 库存量
     */
    @TableField("stock_count")
    private Integer stockCount;

    /**
     * 售卖量
     */
    @TableField("buy_count")
    private Integer buyCount;

    /**
     * 所属店铺id
     */
    @TableField("store_id")
    private Integer storeId;

    /**
     * 状态(0.上架,1.下架)
     */
    @TableField("status")
    private Integer status;

    public Product() {
    }

    public Product(String productName, String productImg, BigDecimal productPrice, Integer type, Integer stockCount, Integer buyCount, Integer storeId, Integer status) {
        this.productName = productName;
        this.productImg = productImg;
        this.productPrice = productPrice;
        this.type = type;
        this.stockCount = stockCount;
        this.buyCount = buyCount;
        this.storeId = storeId;
        this.status = status;
    }

    public Product(Integer id, String productName, String productImg, BigDecimal productPrice, Integer type, Integer stockCount, Integer buyCount, Integer storeId, Integer status) {
        this.id = id;
        this.productName = productName;
        this.productImg = productImg;
        this.productPrice = productPrice;
        this.type = type;
        this.stockCount = stockCount;
        this.buyCount = buyCount;
        this.storeId = storeId;
        this.status = status;
    }

    @Override
    public String toString() {
        return "Product{" +
                "id=" + id +
                ", productName='" + productName + '\'' +
                ", productImg='" + productImg + '\'' +
                ", productPrice=" + productPrice +
                ", type=" + type +
                ", stockCount=" + stockCount +
                ", buyCount=" + buyCount +
                ", storeId=" + storeId +
                ", status=" + status +
                '}';
    }
}
